#pragma once
#include <QString>
#pragma once
#include "IHardware.h"
#include <QObject>


namespace NOpenHardwareMonitor {

namespace NHardware {


class CHardwarePrivate;
class CComputer;
class CSensor;


class CHardware
	: public QObject
	, public IHardware
{
	Q_OBJECT


public:
	CHardware(CComputer* Computer, const qint32& Index);
	CHardware(CHardware* Hardware, const qint32& Index);
	~CHardware();


public:
	virtual void Release() override;


public:
	virtual void Update() override;

	virtual QString GetReport() const override;
	virtual QString GetName() const override;
	virtual EType GetType() const override;
	virtual QString GetIdentifier() const override;
	virtual qint32 GetHashCode() const override;

	virtual qint32 GetSensorCount() const override;
	virtual ISensor* GetSensor(const qint32& Index) override;

	virtual qint32 GetSubHardwareCount() const override;
	virtual IHardware* GetSubHardware(const qint32& Index) override;

	virtual IHDD* GetHDD() override;


private:
	void* GetHandle() const;


private:
	friend CSensor;


private:
	QScopedPointer<CHardwarePrivate> d_ptr;
	Q_DECLARE_PRIVATE(CHardware)
};


}}

